<template>
    <div class="nav_title">Python Web 课程设计 - 教务信息管理系统</div>
    <div class="nav_buttom">
        <a href="javascript:;" @click="logout">退出</a>
    </div>
</template>

<script setup>
import { ElMessageBox } from 'element-plus';
import { cache } from '@/utils/cache';
import { useRouter } from 'vue-router';

const router = useRouter();

const logout = () => {
    ElMessageBox.confirm('您确定要退出系统么?','提示',{
       confirmButtonText:'确定',
       cancelButtonText: '取消'
    }).then(() => {
        //退出系统
        cache.clear()
        router.push('/login')
    })
    .catch(() => {
        // catch error
    })
}

</script>

<style scoped>
.nav_title{
    float:left;
    text-align:left;
    font-size:17px;
    padding: 13px 0px 0px 20px;
    color:white;
}
.nav_buttom{
    float:right;
    text-align:right;
    margin:15px 15px 0px 0px;
}
.nav_buttom a{
    color:white;
    text-decoration:none;
    font-size:13px;
}
.nav_buttom a:hover{
    color:red;
}

</style>